<?php if(isset($data)&&isset($data['id'])&&$data['id']>0): ?>
<?php
$type = (isset($_GET)&&isset($_GET['modele'])&&$_GET['modele']!='')?$_GET['modele']:'publication';
?>
<h3>Redirections :</h3>
<?php $liste = modele_redirection::getListeFromModele($data['id'], $type); ?>
    <table id="liste_redirection" width="100%" class="table_form" style="margin: 15px 0 8px 0;">
        <thead>
            <tr>
                <th>Lien</th>
                <th>Type</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
        <?php if(count($liste)>0): ?>
        <?php foreach($liste as $num => $permalien): ?>
            <tr id="redirection_<?php echo $num; ?>">
                <td class="lien-redirection"><?php echo $permalien->getLien(); ?></td>
                <td class="code-redirection"><?php echo $permalien->getCode(); ?></td>
                <td class="action-redirection" align="right"><a class="pwe-ui-btn confirmAction right" title="Supprimer cette redirection" href="javascript:openRemoveRedirection(<?php echo $num; ?>,'<?php echo $permalien->getLien(); ?>');">supprimer</a> <a class="pwe-ui-btn right" href="javascript:openUpdateRedirection(<?php echo $num; ?>,'<?php echo $permalien->getLien(); ?>');">modifier</a></td>
            </tr>
        <?php endforeach; ?>
        <?php endif; ?>
        </tbody>
    </table>
    <p align="right"><a class="pwe-ui-btn" href="javascript:openAddRedirection(<?php echo $data['id']; ?>,'<?php echo $type; ?>');">Ajouter</a></p>
<?php endif; ?>